from po.base_api import Base_Api
from tools.sqltools import Dbmysql
class ShengBen(Base_Api):

    def shengben_index(self,province_id):
        body = {
            "method":"get",
            "url":self.host+'/zxx/v4/graduate',
            "params":{"province_id":province_id}
        }
        r = self.send(body)
        return  r


    def sb_city(self):
        body = {
            "method":"get",
            "url":self.host+'/zxx/v4/graduate/province'
        }
        r = self.send(body)
        return  r.json()['data'][0]['province_id']

    def shengben_course(self,**kwargs):
        body = {
            "method":"get",
            "url":self.host+ '/zxx/v4/graduate/course',
            "params":{
                **kwargs
            }
        }
        r =self.send(body)
        return r


    def shengben_subject(self,province_id,type):
        body = {
            "method":"get",
            "url":self.host+ '/zxx/v4/Graduate/subject',
            "params":{
                "province_id":province_id,'type':type
            }
        }
        r =self.send(body)
        return r

    def shengben_paper(self,subject_id,**kwargs):
        body = {
            "method":"get",
            "url":self.host+ '/zxx/v4/graduate/papers',
            "params":{
                "subject_id":subject_id,**kwargs
            }
        }
        r = self.send(body)
        return  r